% ---- Time averaged map at surface               
m=squeeze(nanmean(nmodel.data(2,:,:,:),4));      
m(m==0)=NaN;                        
d=squeeze(nanmean(dat.data(2,:,:,:),4));
di=m-d;
mi=min(nanmin(nanmin(d)),nanmin(nanmin(m)));
ma=max(nanmax(nanmax(d)),nanmax(nanmax(m)));

milat=-20;
malat=80;
milon=-98;
malon=52;

switch parameter
   case 'T'
       md=5;
   case 'S'
       md=1;
       mi=32;
       ma=37;
    case 'NO3'
        mi=0;        
        ma=5;
        md=2*nanstd(nanstd(abs(m-d)));
   otherwise
       md=2*nanstd(nanstd(abs(m-d)));
end

close all
gccolor('mp',nmodel.lon,nmodel.lat,m','on',mi,ma,['Model ',kind,' ',parameter,' ',cruise,' - Surface'],milat,malat,milon,malon)    
printgc('-f1','-depsc2',['./PLOT_VALIDATION/WOA05/WOA05_model_',parameter,'_surf.eps'])
close all
gccolor('mp',dat.londata,dat.latdata,d','on',mi,ma,['Data ',kind,' ',parameter,' ',cruise,' - Surface'],milat,malat,milon,malon)    
printgc('-f1','-depsc2',['./PLOT_VALIDATION/WOA05/WOA05_data_',parameter,'_surf.eps'])
close all
gccolor('mp',dat.londata,dat.latdata,di','on',-md,md,['(Model-Data) ',kind,' ',parameter,' ',cruise,' - Surface'],milat,malat,milon,malon)    
load cmap_politoliu
colormap(politoliu)
printgc('-f1','-depsc2',['./PLOT_VALIDATION/WOA05/WOA05_diff_',parameter,'_surf.eps'])
close all

% ---- Monthly map at surface   
for im=1:12
   m=squeeze(nmodel.data(2,:,:,im));      
   m(m==0)=NaN;                        
   d=squeeze(dat.data(2,:,:,im));
   di=m-d;
   mi=min(nanmin(nanmin(d)),nanmin(nanmin(m)));
   ma=max(nanmax(nanmax(d)),nanmax(nanmax(m)));

   milat=-20;
   malat=80;
   milon=-98;
   malon=52;

   switch parameter
       case 'T'
           md=5;
       case 'S'
           md=1;
           mi=32;
           ma=37;
       case 'NO3'
           mi=0;
           ma=5;
           md=2*nanstd(nanstd(abs(m-d)));
       otherwise
           md=2*nanstd(nanstd(abs(m-d)));
   end

   close all
   gccolor('mp',nmodel.lon,nmodel.lat,m','on',mi,ma,['Model ',kind,' ',parameter,' ',cruise,' - Surface - Month:',num2str(im)],milat,malat,milon,malon)    
   printgc('-f1','-depsc2',['./PLOT_VALIDATION/WOA05/WOA05_model_',parameter,'_surf_m',num2str(im),'.eps'])
   close all
   gccolor('mp',dat.londata,dat.latdata,d','on',mi,ma,['Data ',kind,' ',parameter,' ',cruise,' - Surface - Month:',num2str(im)],milat,malat,milon,malon)    
   printgc('-f1','-depsc2',['./PLOT_VALIDATION/WOA05/WOA05_data_',parameter,'_surf_m',num2str(im),'.eps'])
   close all
   gccolor('mp',dat.londata,dat.latdata,di','on',-md,md,['(Model-Data) ',kind,' ',parameter,' ',cruise,' - Surface - Month:',num2str(im)],milat,malat,milon,malon)    
   load cmap_politoliu
   colormap(politoliu)
   printgc('-f1','-depsc2',['./PLOT_VALIDATION/WOA05/WOA05_diff_',parameter,'_surf_m',num2str(im),'.eps'])
   close all
end

% ---- Time averaged map at 100m (level 7)
m=squeeze(nanmean(nmodel.data(7,:,:,:),4));      
m(m==0)=NaN;           
d=squeeze(nanmean(dat.data(7,:,:,:),4));
di=m-d;
mi=min(nanmin(nanmin(d)),nanmin(nanmin(m)));
ma=max(nanmax(nanmax(d)),nanmax(nanmax(m)));

milat=-20;
malat=80;
milon=-98;
malon=52;

switch parameter
   case 'T'
       md=5;
   case 'S'
       md=1;
       mi=32;
       ma=37;
   otherwise
       md=2*nanstd(nanstd(abs(m-d)));
end

close all
gccolor('mp',nmodel.lon,nmodel.lat,m','on',mi,ma,['Model ',kind,' ',parameter,' ',cruise,' - 100m'],milat,malat,milon,malon)    
printgc('-f1','-depsc2',['./PLOT_VALIDATION/WOA05/WOA05_model_',parameter,'_100m.eps'])
close all
gccolor('mp',dat.londata,dat.latdata,d','on',mi,ma,['Data ',kind,' ',parameter,' ',cruise,' - 100m'],milat,malat,milon,malon)    
printgc('-f1','-depsc2',['./PLOT_VALIDATION/WOA05/WOA05_data_',parameter,'_100m.eps'])
close all
gccolor('mp',dat.londata,dat.latdata,di','on',-md,md,['(Model-Data) ',kind,' ',parameter,' ',cruise,' - 100m'],milat,malat,milon,malon)    
load cmap_politoliu
colormap(politoliu)
printgc('-f1','-depsc2',['./PLOT_VALIDATION/WOA05/WOA05_diff_',parameter,'_100m.eps'])
close all

% ---- Time averaged map at 300m (level 12)
m=squeeze(nanmean(nmodel.data(12,:,:,:),4));      
m(m==0)=NaN;           
d=squeeze(nanmean(dat.data(12,:,:,:),4));
di=m-d;
mi=min(nanmin(nanmin(d)),nanmin(nanmin(m)));
ma=max(nanmax(nanmax(d)),nanmax(nanmax(m)));

milat=-20;
malat=80;
milon=-98;
malon=52;

switch parameter
   case 'T'
       md=5;
   case 'S'
       md=1;
       mi=32;
       ma=37;
   otherwise
       md=2*nanstd(nanstd(abs(m-d)));
end

close all
gccolor('mp',nmodel.lon,nmodel.lat,m','on',mi,ma,['Model ',kind,' ',parameter,' ',cruise,' - 300m'],milat,malat,milon,malon)    
printgc('-f1','-depsc2',['./PLOT_VALIDATION/WOA05/WOA05_model_',parameter,'_300m.eps'])
close all
gccolor('mp',dat.londata,dat.latdata,d','on',mi,ma,['Data ',kind,' ',parameter,' ',cruise,' - 300m'],milat,malat,milon,malon)    
printgc('-f1','-depsc2',['./PLOT_VALIDATION/WOA05/WOA05_data_',parameter,'_300m.eps'])
close all
gccolor('mp',dat.londata,dat.latdata,di','on',-md,md,['(Model-Data) ',kind,' ',parameter,' ',cruise,' - 300m'],milat,malat,milon,malon)    
load cmap_politoliu
colormap(politoliu)
printgc('-f1','-depsc2',['./PLOT_VALIDATION/WOA05/WOA05_diff_',parameter,'_300m.eps'])
close all

% ---- Time averaged map at 500m (level 14)
m=squeeze(nanmean(nmodel.data(14,:,:,:),4));      
m(m==0)=NaN;           
d=squeeze(nanmean(dat.data(14,:,:,:),4));
di=m-d;
mi=min(nanmin(nanmin(d)),nanmin(nanmin(m)));
ma=max(nanmax(nanmax(d)),nanmax(nanmax(m)));

milat=-20;
malat=80;
milon=-98;
malon=52;

switch parameter
   case 'T'
       md=5;
   case 'S'
       md=1;
       mi=32;
       ma=37;
   otherwise
       md=2*nanstd(nanstd(abs(m-d)));
end

close all
gccolor('mp',nmodel.lon,nmodel.lat,m','on',mi,ma,['Model ',kind,' ',parameter,' ',cruise,' - 500m'],milat,malat,milon,malon)    
printgc('-f1','-depsc2',['./PLOT_VALIDATION/WOA05/WOA05_model_',parameter,'_500m.eps'])
close all
gccolor('mp',dat.londata,dat.latdata,d','on',mi,ma,['Data ',kind,' ',parameter,' ',cruise,' - 500m'],milat,malat,milon,malon)    
printgc('-f1','-depsc2',['./PLOT_VALIDATION/WOA05/WOA05_data_',parameter,'_500m.eps'])
close all
gccolor('mp',dat.londata,dat.latdata,di','on',-md,md,['(Model-Data) ',kind,' ',parameter,' ',cruise,' - 500m'],milat,malat,milon,malon)    
load cmap_politoliu
colormap(politoliu)
printgc('-f1','-depsc2',['./PLOT_VALIDATION/WOA05/WOA05_diff_',parameter,'_500m.eps'])
close all

% ---- NS Time averaged vertical section at 30.5W
m=squeeze(nanmean(nmodel.data(:,150,:,:),4));    
m(m==0)=NaN;             
d=squeeze(nanmean(dat.data(:,150,:,:),4));
di=m-d;
mi=min(nanmin(nanmin(d)),nanmin(nanmin(m)));
ma=max(nanmax(nanmax(d)),nanmax(nanmax(m)));

miY=min(-dat.depthdata);
maY=max(-dat.depthdata);
miX=-20;
maX=80;

switch parameter
   case 'T'
       md=5;
   case 'S'
       mi=32;
       ma=37;
       md=1;
   otherwise
       md=2*nanstd(nanstd(abs(m-d)));
end

close all
gccolor('clc',nmodel.lat,-nmodel.depth,m,'on',mi,ma,['Model ',kind,' ',parameter,' ',cruise,'30W NS'],miY,maY,miX,maX)    
xlabel('Latitude')
ylabel('Depth (m)')
printgc('-f1','-depsc2',['./PLOT_VALIDATION/WOA05/WOA05_model_',parameter,'_30W_NS.eps'])
close all
gccolor('clc',dat.latdata,-dat.depthdata,d,'on',mi,ma,['Data ',kind,' ',parameter,' ',cruise,'30W NS'],miY,maY,miX,maX)    
xlabel('Latitude')
ylabel('Depth (m)')   
printgc('-f1','-depsc2',['./PLOT_VALIDATION/WOA05/WOA05_data_',parameter,'_30W_NS.eps'])
close all
gccolor('clc',dat.latdata,-dat.depthdata,di,'on',-md,md,['(Model-Data) ',kind,' ',parameter,' ',cruise,'30W NS'],miY,maY,miX,maX)    
xlabel('Latitude')
ylabel('Depth (m)')   
load cmap_politoliu
colormap(politoliu)
printgc('-f1','-depsc2',['./PLOT_VALIDATION/WOA05/WOA05_diff_',parameter,'_30W_NS.eps'])
close all


% ---- EW Time averaged vertical section at 36.5N
m=squeeze(nanmean(nmodel.data(:,:,127,:),4));   
m(m==0)=NaN;
d=squeeze(nanmean(dat.data(:,:,127,:),4));
di=m-d;
mi=min(nanmin(nanmin(d)),nanmin(nanmin(m)));
ma=max(nanmax(nanmax(d)),nanmax(nanmax(m)));

miY=min(-dat.depthdata);
maY=max(-dat.depthdata);
miX=-76;
maX=28.5;

switch parameter
   case 'T'
       md=5;
   case 'S'
       md=1;
       mi=32;
       ma=37;
   otherwise
       md=2*nanstd(nanstd(abs(m-d)));
end               

close all
gccolor('clc',nmodel.lon,-nmodel.depth,m,'on',mi,ma,['Model ',kind,' ',parameter,' ',cruise,'36.5N EW'],miY,maY,miX,maX)    
printgc('-f1','-depsc2',['./PLOT_VALIDATION/WOA05/WOA05_model_',parameter,'_36N_EW.eps'])   
xlabel('Longitude')
ylabel('Depth (m)')
close all
gccolor('clc',dat.londata,-dat.depthdata,d,'on',mi,ma,['Data ',kind,' ',parameter,' ',cruise,'36.5N EW'],miY,maY,miX,maX)     
xlabel('Longitude')
ylabel('Depth (m)')  
printgc('-f1','-depsc2',['./PLOT_VALIDATION/WOA05/WOA05_data_',parameter,'_36N_EW.eps'])
close all
gccolor('clc',dat.londata,-dat.depthdata,di,'on',-md,md,['(Model-Data) ',kind,' ',parameter,' ',cruise,'36.5N EW'],miY,maY,miX,maX)       
xlabel('Longitude')
ylabel('Depth (m)')
load cmap_politoliu
colormap(politoliu)
printgc('-f1','-depsc2',['./PLOT_VALIDATION/WOA05/WOA05_diff_',parameter,'_36N_EW.eps'])
close all



% ---- surface hovmoller at 9.5N
m=squeeze(nmodel.data(2,:,100,:));   
m(m==0)=NaN;
d=squeeze(dat.data(2,:,100,:));
di=m-d;

miY=min(dat.timedata);
maY=max(dat.timedata);
miX=-60.5;
maX=-14.5;

switch parameter
   case 'T'
       md=5;
   case 'S'
       md=1;
   otherwise
       md=2*nanstd(nanstd(abs(m-d)));
end               


close all               
gccolor('clc',dat.londata,dat.timedata,di','on',-md,md,['(Model-Data) ',kind,' ',parameter,' ',cruise,'9.5N hov'],miY,maY,miX,maX)       
xlabel('Longitude')
ylabel('Months')
load cmap_politoliu
colormap(politoliu)
printgc('-f1','-depsc2',['./PLOT_VALIDATION/WOA05/WOA05_diff_',parameter,'_9N_hov.eps'])
close all



% ---- surface hovmoller at 25.5N
m=squeeze(nmodel.data(2,:,116,:));   
m(m==0)=NaN;
d=squeeze(dat.data(2,:,116,:));
di=m-d;

miY=min(dat.timedata);
maY=max(dat.timedata);
miX=-98;
maX=-15.5;

switch parameter
   case 'T'
       md=5;
   case 'S'
       md=1;
   otherwise
       md=2*nanstd(nanstd(abs(m-d)));
end               


close all               
gccolor('clc',dat.londata,dat.timedata,di','on',-md,md,['(Model-Data) ',kind,' ',parameter,' ',cruise,'25.5N hov'],miY,maY,miX,maX)       
xlabel('Longitude')
ylabel('Months')
load cmap_politoliu
colormap(politoliu)
printgc('-f1','-depsc2',['./PLOT_VALIDATION/WOA05/WOA05_diff_',parameter,'_25N_hov.eps'])
close all




% ---- surface hovmoller at 34.5N
m=squeeze(nmodel.data(2,:,125,:));   
m(m==0)=NaN;
d=squeeze(dat.data(2,:,125,:));
di=m-d;

miY=min(dat.timedata);
maY=max(dat.timedata);
miX=-75.5;
maX=22.5;

switch parameter
   case 'T'
       md=5;
   case 'S'
       md=1;
   otherwise
       md=2*nanstd(nanstd(abs(m-d)));
end               


close all               
gccolor('clc',dat.londata,dat.timedata,di','on',-md,md,['(Model-Data) ',kind,' ',parameter,' ',cruise,'34.5N hov'],miY,maY,miX,maX)       
xlabel('Longitude')
ylabel('Months')
load cmap_politoliu
colormap(politoliu)
printgc('-f1','-depsc2',['./PLOT_VALIDATION/WOA05/WOA05_diff_',parameter,'_34N_hov.eps'])
close all





% ---- surface hovmoller at 40.5N
m=squeeze(nmodel.data(2,:,131,:));   
m(m==0)=NaN;
d=squeeze(dat.data(2,:,131,:));
di=m-d;

miY=min(dat.timedata);
maY=max(dat.timedata);
miX=-72.5;
maX=14.5;

switch parameter
   case 'T'
       md=5;
   case 'S'
       md=1;
   otherwise
       md=2*nanstd(nanstd(abs(m-d)));
end               


close all               
gccolor('clc',dat.londata,dat.timedata,di','on',-md,md,['(Model-Data) ',kind,' ',parameter,' ',cruise,'40.5N hov'],miY,maY,miX,maX)       
xlabel('Longitude')
ylabel('Months')
load cmap_politoliu
colormap(politoliu)
printgc('-f1','-depsc2',['./PLOT_VALIDATION/WOA05/WOA05_diff_',parameter,'_40N_hov.eps'])
close all

